
<?php if(!empty($this->alert)):?>
<div class="container">
<div class="alert alert-<?php echo $this->alertType; ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?php 	echo $this->translate($this->alert); ?>
</div>
</div>
<?php endif;?>

<?php 
if(count($this->offers) != 0)
{?>
<div class="mapBanner">
<?php  echo $this->action('reqmap', 'map', null, $this->modules);  ?>
</div>
<div class="container">
<div id="resultsContainer">
<ul class="thumbnails">
<?php $i = 0;?>
<?php foreach ($this->offers as $offer){ ?>
<?php $object = $offer->object;
	  $images = $object->images;
	  $imageurl = $images[0]->url;
	  $user = $offer->user; 
	  $helperUrl = new Zend_View_Helper_Url ( );
	  $profilLink = $helperUrl->url ( array ('id_user' => $user->userId ) , 'profilRoute', true);
	  $objecturl = 'view/'.strtolower($offer->classe).'/'.$offer->id_classe.'-'.Application_Model_Tool_ObjectUrl::getObjectNameUrl($object->name);
	  $address = $offer->addresses[0];
	  $commenturl = $objecturl.'#disqus_thread';
	  ?>
		<li class="span6">
	    <div id="accordion-map-<?php echo $i; ?>" tabindex="<?php echo $i; $i++; ?>" class="thumbnail">
	    	<div class="headBlock">
	    		<div class="titleBlock">
		    		<h4><a href="<?php echo $this->baseUrl($objecturl); ?>" title="<?php //echo $this->translate($request->requestId); ?>"><?php echo $object->name?></a></h4>
		    		<small><?php echo ($offer) ? $this->translate($offer->classe) : "" ?> <?php echo ($address) ? " - ".$address->city : "" ?></small>
		    	</div>
		    	
		    	
	    	</div>
	    	<div class="photoContainer">
			    <img class="img-polaroid" alt="" style="width: 120px; height: 90px;" src="<?php echo $this->baseUrl('img/object/'.$imageurl); ?>"></img>
	    	</div>
	    	<div class="avatarContainer">
	    		<a href="<?php echo $profilLink; ?>" title="<?php echo $user->firstName." ".$user->lastName; ?>"><img class="img-rounded" src="<?php echo $this->baseUrl('img/profil/'.$user->avatar);?>" style="width: 35px; height: 35px;"></img></a>
	    	</div>
	    	<div class="price">
	    		<?php echo $offer->price." ".$offer->price_currency; ?>
	    	</div>
	    	<div class="detail phrases">
	    		
		    	<p>	
			    	<?php echo $offer->description?> <br>
			    </p>
	    	</div>
	    	<div class="resultFooter">
	    		<p><?php $time =  $this->timeSince(strtotime($offer->start_date));
	    			echo $this->translate('%1$s %2$s ago', $time['nb'] ,$time['text']); ?></p>
	    		<div class="commentContainer">
		    		<a class="btn btn-mini btn-success dropdown-toggle" href="<?php echo $this->baseUrl($commenturl); ?>">
					Comments
					</a>
		    	</div>
	    	</div>
	    </div>
	    </li>
		
<?php } ?>
</ul>
</div>
</div>
<?php 
}

?>